package com.yanftch.hdc_tools.common

import com.intellij.notification.NotificationGroupManager
import com.intellij.notification.NotificationType
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project

object NotificationHelper {

    fun error(message: String?, project: Project?) {
        sendNotification(message, project, NotificationType.ERROR)
    }

    fun info(message: String?, project: Project?) {
        sendNotification(message, project, NotificationType.INFORMATION)
    }

    private fun sendNotification(message: String? = "", project: Project?, type: NotificationType = NotificationType.INFORMATION) {
        if (project == null) return
        NotificationGroupManager.getInstance().getNotificationGroup("id_hdc_tools_pop").createNotification("", message ?: "", type)
            .notify(project)
    }
}